//
//  GameViewFour.m
//  2048
//
//  Created by 高新川 on 15/6/7.
//  Copyright (c) 2015年 高新川. All rights reserved.
//

#import "GameViewFour.h"
#import "Game.h"
#import "PaneView.h"

const int sizes = 4;

@implementation GameViewFour

- (id)init {
    self = [super init];
    if (self) {
        _size = 4;
    }
    return self;
}

/*
 * view 大小290*290
 * 放5*5的格子
 * 间距10，格子大小60
 **/
- (void)initViews {
    for (int i = 0; i < _size; i++) {
        for (int j = 0; j < _size; j++) {
            PaneView *view = (PaneView *)[[self.viewArray objectAtIndex:i] objectAtIndex:j];
            view.frame = CGRectMake(10 + 70*j, 10 + 70*i, 60, 60);
            UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 60, 60)];
            label.textAlignment = 1;
            [view addSubview:label];
            view.textLabel = label;
            
            [self addSubview:view];
        }
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
